package edu.whu.rose.clock.kps.algorithm.blinks2.search3;

import edu.whu.rose.clock.util.priorityqueue.FibonacciHeapPQ;
import edu.whu.rose.clock.util.priorityqueue.UnderflowException;

public class GroupHeap31 {

	private FibonacciHeapPQ<Cursor31> heap;
	
	public GroupHeap31() {
		heap = new FibonacciHeapPQ<Cursor31>();
	}
	
	public void enqueue(Cursor31 knc) {
		heap.enqueue(knc);
	}
	
	public Cursor31 dequeue() {
		Cursor31 knc = null;
		try {
			knc = heap.dequeueMin();
		}
		catch (UnderflowException ex) {
			ex.printStackTrace();
		}
		return knc;
	}
	
	public short top() {
		try {
			return heap.findMin().peek();
		}
		catch (UnderflowException ex) {
			ex.printStackTrace();
		}
		return Short.MAX_VALUE;
	}
	
	public boolean isEmpty() {
		return heap.isEmpty();
	}

}
